﻿#region

using System.Windows.Browser;

#endregion

namespace Radovici.SharedLibrary
{
    //public static class Clipboard
    //{
    //    private const string BeforeFlashCopy = "The text will now attempt to be copied...";
    //    private const string ClipboardFailure = "The text couldn't be copied into the clipboard.";
    //    // HARD-CODED!  
    //    private const string ClipboardFlashMovie = "SyntaxHighlighter/js/clipboard.swf";
    //    private const string FlashMimeType = "application/x-shockwave-flash";
    //    private const string HostNoClipboard = "The clipboard isn't available in the current host.";
    //    /// <summary>  
    //    /// Write to the clipboard (IE and/or Flash)  
    //    /// </summary>  
    //    public static void SetText(string text)
    //    {
    //        // document.window.clipboardData.setData(format, data);  
    //        var clipboardData = (ScriptObject) HtmlPage.Window.GetProperty("clipboardData");
    //        if (clipboardData != null)
    //        {
    //            var success = (bool) clipboardData.Invoke("setData", "text", text);
    //            if (!success)
    //            {
    //                HtmlPage.Window.Alert(ClipboardFailure);
    //            }
    //        }
    //        else
    //        {
    //            HtmlPage.Window.Alert(BeforeFlashCopy);
    //            // Append a Flash embed element with the data encoded  
    //            string safeText = HttpUtility.UrlEncode(text);
    //            HtmlElement elem = HtmlPage.Document.CreateElement("div");
    //            HtmlPage.Document.Body.AppendChild(elem);
    //            elem.SetProperty("innerHTML", "<embed src=\"" +
    //                                          ClipboardFlashMovie + "\" " +
    //                                          "FlashVars=\"clipboard=" + safeText + "\" width=\"0\" " +
    //                                          "height=\"0\" type=\"" + FlashMimeType + "\"></embed>");
    //        }
    //    }
    //}
}